from pydantic import BaseModel

from forward.extend.pydantic.base import BaseSchema
from forward.utils.tools import ToolsUtil


class CodeAddInSchema(BaseSchema):
    pass


class CodeEditInSchema(BaseSchema):
    id: int


class CodeListInSchema(BaseSchema):
    export: int | None = None
    merchant_id: int | None = None
    prize_id: int | None = None
    status: int | None = None
    page_num: int = 1
    page_size: int = 20
    model_config = {
        "alias_generator": ToolsUtil.to_lower_camel,
        "populate_by_name": True,
    }


class CodeDetailInSchema(BaseModel):
    code: str


class CodeDeleteInSchema(BaseModel):
    id: int


class GenerateInSchema(BaseModel):
    num: int
    begin_num: int
    end_num: int
    prefix: str


class CodeStatusInSchema(BaseModel):
    id: int
    status: int


class ActivityExportInSchema(BaseSchema):
    num: int
    begin_num: int
    end_num: int
    prefix: str
